<template>
	<view class="record_box"  >

		<view class="userInfo w card" v-for="items in list">
			<view class="dpflxrjb header wp">
				<view class="dpflxr">
					<view class="icon">
						<image src="../../static/images/icon_gjlu.png"></image>
					</view>
					<text>{{items.createdTime}}</text>
				</view>
				<text class="del" @click="del(items.id)">删除</text>
			</view>
			<view class="dpflxrjb wp">
				<view class="ifItem">
					<text class="title">预约到店：</text>
					<text>{{items.preConvention==1?'是':'否'}}</text>
				</view>
				<view class="ifItem">
					<text class="title">到店时间：</text>
					<text>{{items.actualTime}}</text>
				</view>
				
				<view class="ifItem content">
					<view v-if="items.content==='undefined'">
						<text class="title">跟进内容:</text>
						<text>暂无</text>
					</view>
					<view v-else>
						<text class="title">跟进内容:</text>
						<text>{{items.content}}</text>
					</view>
				</view>
				
			</view>
		</view>
		
	</view>
</template>

<script>
	import request from "@/api/index.js";
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad(options){
			console.log(options.userid);
			this.userId=options.userid;
			this.records();
		},
		methods: {
			records: function(e) {
				request.http('/shop/store-api/' + uni.getStorageSync('shop_id') + '/frontUserinfo/pageGenjing', 'POST',{
					'userId':this.userId
				}).then(res => {
					console.log(res);
					this.list=res.data.data.records;
				})
				
			},
			
			del(id) {
				console.log(id);
				var userid=this.userId;
				request.http('/shop/store-api/' + uni.getStorageSync('shop_id') + '/frontTrack/'+id, 'DELETE').then(res => {
					uni.redirectTo({
						url: "/pages/index_membership_detail_record/index_membership_detail_record?userid="+userid
					})
				})
				
				
				// request.http('/shop/store-api/' + uni.getStorageSync('shop_id') + '/frontTrack/'+id, 'delete').then(res => {
				// 	uni.reLaunch({
				// 		url: '/pages/index_membership_detail_record/index_membership_detail_record'
				// 	})
				// })
			},
			
		}
	}
</script>

<style src="../../static/css/app.css"></style>
<style>
	page{
		padding-bottom: 20rpx;
	}
	.card{
		border-radius: 20rpx;
	}
	.userInfo{
		box-sizing: border-box;
		padding: 0rpx 0rpx 6rpx 0rpx;
	}
	.userInfo .ifItem{
		width: 50%;
		line-height: 36rpx;
		margin-bottom: 18rpx;
	}
	.userInfo .ifItem.content{
		width: 100%;
	}
	.userInfo .ifItem .title{
		color: #999;
		display: block;
	}
	.header{
		line-height: 80rpx;
		border-bottom: 1rpx #eee solid;
		margin-bottom: 30rpx;
		color: #F9600D;
	}
	.header .icon{
		width: 32rpx;
		height: 32rpx;
		margin-right: 17rpx;
	}
	.header .del{
		color: #999;
	}
</style>
